/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Damian
 */
@Entity
@Table(name = "suscriptions")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Suscriptions.findAll", query = "SELECT s FROM Suscriptions s"),
    @NamedQuery(name = "Suscriptions.findByIdSuscription", query = "SELECT s FROM Suscriptions s WHERE s.idSuscription = :idSuscription")})
public class Suscriptions implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_SUSCRIPTION")
    private Integer idSuscription;
    @JoinColumn(name = "ID_LOCAL", referencedColumnName = "ID_LOCAL")
    @ManyToOne(optional = false)
    private Local idLocal;
    @JoinColumn(name = "ID_CLIENT", referencedColumnName = "ID_CLIENT")
    @ManyToOne(optional = false)
    private Client idClient;

    public Suscriptions() {
    }

    public Suscriptions(Integer idSuscription) {
        this.idSuscription = idSuscription;
    }

    public Integer getIdSuscription() {
        return idSuscription;
    }

    public void setIdSuscription(Integer idSuscription) {
        this.idSuscription = idSuscription;
    }

    public Local getIdLocal() {
        return idLocal;
    }

    public void setIdLocal(Local idLocal) {
        this.idLocal = idLocal;
    }

    public Client getIdClient() {
        return idClient;
    }

    public void setIdClient(Client idClient) {
        this.idClient = idClient;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSuscription != null ? idSuscription.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Suscriptions)) {
            return false;
        }
        Suscriptions other = (Suscriptions) object;
        if ((this.idSuscription == null && other.idSuscription != null) || (this.idSuscription != null && !this.idSuscription.equals(other.idSuscription))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.Suscriptions[ idSuscription=" + idSuscription + " ]";
    }
    
}
